package gybase01
/*
配置Groovy开发环境(Windows)
https://www.jianshu.com/p/777cc61a6202

IntelliJ IDEA创建第一个Groovy工程
https://blog.csdn.net/qq_29860591/article/details/105853214

基于IntelliJ IDEA创建第一个Groovy工程
https://www.cnblogs.com/taoweizhong/p/10991434.html
*/

class TestGroovy {

    static void main(String[] args) {
        def num = 10
        println(" num : $num")

        //除了每行代码不用加分号外，Groovy中函数调用的时候还可以不加括号
        def text = "hello groovy"
        println text

        // num : 10
        //hello groovy

        for (k in 0..<3){
            println "k  = $k"
        }

        3.times {
            println "it  = $it"
        }

        //k  = 0
        //k  = 1
        //k  = 2
        //it  = 0
        //it  = 1
        //it  = 2
    }
}
